<?php

/**
 * @package NUKEVIET
 * @subpackage WikiDic Service
 * @author Long Nguyen (long@wpvampire.com)
 * @copyright 2011
 * @since 3.2
 */

if ( ! defined( 'NV_IS_WIKIDICSERVICE_ADMIN' ) ) die( 'Stop!!!' );

$page_title = $lang_module['apps_add'];

$users = get_users('field_key=active&field_value=1');
foreach ($users as $user) {
	$options[$user->userid] = $user->username;
}
$form['user_select'] = html_selectbox('user_id', $options, 1);

$statuses = array(
	APP_STATUS_AWATING_APPROVED => $lang_module['APP_STATUS_AWATING_APPROVED'],
	APP_STATUS_ENABLED => $lang_module['APP_STATUS_ENABLED'],
	APP_STATUS_SUSPENDED => $lang_module['APP_STATUS_SUSPENDED'],
);
$form['status_select'] = html_selectbox('status', $statuses, APP_STATUS_AWATING_APPROVED);

$form['action'] = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=apps_edit";

$xtpl = new XTemplate("apps_add.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_name);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('FORM', $form);

$xtpl->parse('main');
$contents = $xtpl->text('main');

include (NV_ROOTDIR . "/includes/header.php");
echo nv_admin_theme($contents);
include (NV_ROOTDIR . "/includes/footer.php");
?>